package gao.xaiolei.enity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class TaskReceiverId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 307635909464407333L;

	// 任务接受人Id
	@Column(name = "TR_USER_ID", nullable = false, columnDefinition = "char(32)")
	private String TR_USER_ID;

	// 任务Id
	@Column(name = "TR_TASK_ID", nullable = false, columnDefinition = "char(32)")
	private String TR_TASK_ID;

	public TaskReceiverId() {
		super();
	}

	public TaskReceiverId(String tR_TASK_ID,String tR_USER_ID) {
		super();
		TR_USER_ID = tR_USER_ID;
		TR_TASK_ID = tR_TASK_ID;
	}

	public String getTR_USER_ID() {
		return TR_USER_ID;
	}

	public void setTR_USER_ID(String tR_USER_ID) {
		TR_USER_ID = tR_USER_ID;
	}

	public String getTR_TASK_ID() {
		return TR_TASK_ID;
	}

	public void setTR_TASK_ID(String tR_TASK_ID) {
		TR_TASK_ID = tR_TASK_ID;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((TR_TASK_ID == null) ? 0 : TR_TASK_ID.hashCode());
		result = prime * result
				+ ((TR_USER_ID == null) ? 0 : TR_USER_ID.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TaskReceiverId other = (TaskReceiverId) obj;
		if (TR_TASK_ID == null) {
			if (other.TR_TASK_ID != null)
				return false;
		} else if (!TR_TASK_ID.equals(other.TR_TASK_ID))
			return false;
		if (TR_USER_ID == null) {
			if (other.TR_USER_ID != null)
				return false;
		} else if (!TR_USER_ID.equals(other.TR_USER_ID))
			return false;
		return true;
	}
}
